/*
 * Copyright (C) 2013 AndXmppSDK Project <hljdrl@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.drl.xmpp;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 
 * 消息-聊天的消息对象
 * 
 * @author hljdrl@gmail.com
 * 
 */
public final class TSession implements Parcelable {

	public static final Parcelable.Creator<TSession> CREATOR = new Parcelable.Creator<TSession>() {

		@Override
		public TSession createFromParcel(Parcel source) {
			return new TSession(source);
		}

		@Override
		public TSession[] newArray(int size) {
			return new TSession[size];
		}
	};
	
	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(id);
		dest.writeString(UserName);
		dest.writeString(mForm);
		dest.writeString(body);
		dest.writeString(time);
		dest.writeInt(count);
	}
	
	public TSession(Parcel in) {
		id = in.readLong();
		UserName = in.readString();
		mForm = in.readString();
		body = in.readString();
		time = in.readString();
		count = in.readInt();
	}
	
	public Long id;
	private String UserName;
	private String mForm;
	private String body;
	private String time;
	private int count;

	public TSession(String user, String form) {
		UserName = user;
		mForm = form;
	}

	public String getUserName() {
		return this.UserName;
	}

	public String getSessionName() {
		return this.mForm;
	}

	public String getSessionJid() {
		return this.mForm;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	

}
